#include "CBoard.h"
#include <stdlib.h>
#include <string>
using namespace std;
CBoard::CBoard()
{
}
CBoard::~CBoard()
{
}
void CBoard::Refresh()
{
        system("clear");
        string str1 = "┼";
        string str2 = "●";
        string str3 = "▲";
        string str4 = "○";
        string str5 = "△";
        int m = 0;
        cout << " ";
        while (m < 15)
        {
                
                cout <<(char) (m + 1+64)<<" ";
                m++;
        }
        cout << endl;
        int i = 0;
        while (i < 15)
        {
                int j = 0;
                cout <<(char)( i + 1+64);
                while (j < 15)
                {
                        if (board[i][j] == 0)
                        {
                                cout << str1;
                                cout<<" ";
                        }
                        if (board[i][j] == -2)
                        {
                                cout << str5;
                                cout<<" ";
                                board[i][j] = -1;
                        }
                        if (board[i][j] == 2)
                        {
                                cout << str3;
                                 cout<<" ";
                                board[i][j] = 1;
                        }
                        if (board[i][j] == -1)
                        {
                                cout << str4;
                                cout<<" ";
                        }
                        if (board[i][j] == 1)
                        {
                                cout << str2;    
                                cout<<" ";
                        }
                        j++;
                }
                cout << endl;
                i++;
        }
}